package org.example.login.Impl;



import org.example.login.Strategy.ConcreteStrategyC;
import org.example.login.Strategy.ConcreteStrategyD;
import org.example.login.Strategy.ContextU;
import org.example.login.Strategy.Strategy0;
import org.example.login.service.LoginService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;



@Service
public class LoginServiceImpl implements LoginService {
    public  Map<String, Object> c(Object list, Strategy0 s, Map<String, Object>response){
        ContextU c=new ContextU();
        c.setStrategy0(s);
        c.strategyMethod0(list);
        response=s.getresponse();
        return response;
    }

    public Map<String, Object> Chiek(Object list){
        ContextU c=new ContextU();
        Map<String, Object>response=new HashMap<>();
        if (list != null) {
            Strategy0 s = new ConcreteStrategyD();
            // 根据需要添加其他响应数据
            return c(list,s,response);
        } else {
            Strategy0 s = new ConcreteStrategyC();
            // 根据需要添加其他响应数据
            return c(list,s,response);
        }
    }
}
